package com.msb.test05;

public class TestArray {
    public static void main(String[] args) {
        //方式一
        int [] arr;
        arr = new int[4];
        arr[0]=0;
        arr[1]=1;
        arr[2]=2;
        arr[3]=3;
        System.out.println("\n");
        System.out.println(arr);

        int [] arr2 = {1,2,3,4,5};
        System.out.println(arr2);



        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }

        System.out.println("增强for循环");
        for (int num:arr2) {
            System.out.println(num);
        }

    }
}
